import type { LoginFormState } from '@/types'
import { service } from '@/utils/axios'

const BASE_URL = '/v1/auth'
// User login api
export function loginApi(data: LoginFormState): Promise<any> {
  return service({
    url: `${BASE_URL}/login`,
    method: 'post',
    data,
    headers: {
      'Content-Type': 'application/json'
    }
  })
}

// User logout api
export function logoutApi() {
  return service({
    url: `${BASE_URL}/logout`,
    method: 'delete'
  })
}
